package com.example.wordserver.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.wordserver.entity.Country;
import com.example.wordserver.service.impl.CountryServiceImpl;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lhx
 * @since 2024-01-27
 */
@RestController
@RequestMapping("/country")
public class CountryController {
@Resource
private CountryServiceImpl countryService=new CountryServiceImpl();
@GetMapping("/getByCode/{Code}")
    public Country getByCode(@PathVariable String Code)
{
    QueryWrapper<Country> countryQueryWrapper=new QueryWrapper<>();
    countryQueryWrapper.eq("Code",Code);
    return  countryService.getOne(countryQueryWrapper);
}
}

